﻿using Practice.PH4_2104A.DAL;
using Practice.PH4_2104A.IRepository;
using Practice.PH4_2104A.Shopping.SevenLayerFramework.Domin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Practice.PH4_2104A.Repository
{
    public class SKUImageRepository : ISKUImageRepository
    {
        MyDbContext _context;

        public SKUImageRepository(MyDbContext context)
        {
            _context = context;
        }

        //查询所有
        public IQueryable<SKUImageModel> GetAll()
        {
            return _context.SKUImages;
        }

        //添加一条
        public void Insert(SKUImageModel model)
        {
            _context.SKUImages.Add(model);
        }

        //批量添加
        public void Insert(List<SKUImageModel> models)
        {
            _context.SKUImages.AddRange(models);
        }
    }
}
